<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Full Screen Image with Text Overlay</title>
    <link rel="stylesheet" href="styles.css">
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body,
        html {
            height: 100%;
            overflow: hidden;
            /* Prevent scrolling */
        }

        .image-container {
            position: relative;
            width: 100%;
            height: 100vh;
            /* Viewport height */
            overflow-y: auto;
            /* Enable vertical scrolling */
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .image-container img {
            margin-top: 207px;
            width: 100%;
            height: auto;
            object-fit: cover;
            /* Make sure the image covers the whole container */
        }

        .text-overlay {
            position: absolute;
            width: 100%;
            height: 500px;
            top: 59%;
            left: 50%;
            transform: translate(-50%, -50%);
            /* color: white;
            background-color: rgba(0, 0, 0, 0.5);

            padding: 10px 20px;
            border-radius: 5px; */
            text-align: center;
        }

        .text-overlay h1 {
            margin: 0;
            font-size: 24px;
        }

        #time {
            font-size: 21px;
            /* 字体大小可选 */
            color: #2CB27E;
            /* 字体颜色可选 */
            font-weight: 750;
        }

        #date {
            margin-top: 10px;
            font-size: 11px;
            /* 字体大小可选 */
            color: #2CB27E;
            /* 字体颜色可选 */
        }

        #se {
            font-size: 13px;
            color: black;
            margin-top: 435px;
            margin-left: 151px;
            font-weight: 800;
        }

        .text-with-lines {
            position: relative;
            display: inline-block;
            padding: 0 15px;
            /* 给文字左右留出一些空间，以便横线显示 */
        }

        .text-with-lines::before,
        .text-with-lines::after {
            content: "";
            position: absolute;
            top: 50%;
            width: 70px;
            /* 横线的长度，可以根据需要调整 */
            height: 1px;
            /* 横线的粗细 */
            background-color: #2CB27E;
            /* 横线的颜色 */
            transform: translateY(-50%);
        }

        .text-with-lines::before {
            left: -69px;
            /* 调整横线的位置，使其出现在文字前面 */
        }

        .text-with-lines::after {
            right: -69px;
            /* 调整横线的位置，使其出现在文字后面 */
        }
    </style>
</head>

<body>
    <div class="image-container">
        <img src="4.jpg" alt="Full Screen Image">
        <div class="text-overlay">
            <p id="time" class="centered-text"></p>
            <p id="date" class="centered-text text-with-lines"></p>
            <p id="se" class="centered-text"></p>
        </div>

    </div>
    <script>
        function updateDateTime() {
            const now = new Date();
            const year = now.getFullYear();
            const month = String(now.getMonth() + 1).padStart(2, '0');
            const day = String(now.getDate()).padStart(2, '0');
            const hours = String(now.getHours()).padStart(2, '0');
            const minutes = String(now.getMinutes()).padStart(2, '0');
            const seconds = String(now.getSeconds()).padStart(2, '0');

            const timeString = `${hours} : ${minutes} : ${seconds}`;
            const dateString = `${year}年${month}月${day}日`;
            document.getElementById("time").innerText = timeString;
            document.getElementById("date").innerText = dateString;

            const se = `${month}-${day} 00:00 至 ${month}-${day} 23:59`;
            document.getElementById("se").innerText = se;
        }


        window.addEventListener('DOMContentLoaded', (event) => {
            // 初始调用以设置初始时间
            updateDateTime();
            // 设置每秒更新一次
            setInterval(updateDateTime, 1000);
        });


    </script>
</body>

</html>